<include file="./admin/Tpl/Public/_header.html" />

<div class="so_main">
  <div class="page_tit">密码修改</div>
  
  <div class="form2">
  	<form method="post" action="editAdmin" id="form" >
    <dl class="lineD">
      <dt>用户名：</dt>
      <dd>
        <input name="web_title" type="text"   disabled value="{$admin.username}">
      </dd>
    </dl>
    <dl class="lineD">
      <dt>旧密码：</dt>
      <dd>
        <input name="oldpassword"  id="oldpassword" type="text" value="">  
      </dd>
    </dl>
    <dl class="lineD">
      <dt>新密码：</dt>
      <dd>
        <input name="newpassword"  id="newpassword" type="text" value="">
      </dd>
    </dl>
    <dl class="lineD">
      <dt>重复新密码：</dt>
      <dd>
        <input name="newpassword2"  id="newpassword2" type="text" value="{$configs[web_title]}">
      </dd>
    </dl>    
    <div class="page_btm">
      <input type="hidden"  name="id" class="btn_b" value="{$admin.id}" />
      <input type="button" id="sub" class="btn_b" value="确定" />
    </div>
    </form>
  </div>

</div>
<script>
  $(document).ready(function(){

$("#sub").click(function(){

if($("#oldpassword").val() == '' || $("#newpassword").val() == '' || $("#newpassword2").val() == ''){
              ui.error('密码为空');
}else{


        var password =$("#oldpassword").val();
        $.post('checkPassword',{password:password},function(res){
           if(res=='0') {
            ui.error('旧密码不正确');
          }else{
if($("#newpassword").val() != $("#newpassword2").val() ){
  ui.error('两次密码输入不一致');
}else{
             $("#form").submit();  
}

          }
        });  
}



});

    });
</script>
<include file="./Tpl/default/Public/_footer.html" />